package com.kelaite.procurement.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity(name = "t_sales_order_items")
public class TSalesOrderItems extends TBaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "order_id")
	private TSalesOrder tSalesOrder;

	@Column(name = "order_item_no")
	private int orderItemNo;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "material_id")
	private TMaterialMasterClient tMaterialMasterClient;

	@Column(name = "quantity")
	private Double quantity;

	@ManyToOne(cascade = CascadeType.REFRESH, optional = false)
	@JoinColumn(name = "unit_id")
	private TUnit tUnit;

	@Column(name = "unit_price")
	private Double unitPrice;

	@Column(name = "sub_total")
	private Double subTotal;

	@Column(name = "material_pic")
	private String materialPic; // 冗余字段

	@Column(name = "quantity_delivered")
	private Double quantityDelivered;

	@Column(name = "quantity_confirmed")
	private Double quantityConfirmed;

	@Column(name = "planed_time")
	private Date planedTime;

	@Column(name = "actual_time")
	private Date actualTime;

	@Column(name = "gmt_create_time")
	private Date gmtCreateTime;

	@Column(name = "gmt_update_time")
	private Date gmtUpdateTime;

	@Column(name = "created_by")
	private String createdBy;

	@Column(name = "updated_by")
	private String updatedBy;

	@Column(name = "is_delete")
	private boolean isDelete;

	public TSalesOrderItems() {

	}

	public Long getId() {

		return id;
	}

	public void setId(Long id) {

		this.id = id;
	}

	public TSalesOrder gettSalesOrder() {

		return tSalesOrder;
	}

	public void settSalesOrder(TSalesOrder tSalesOrder) {

		this.tSalesOrder = tSalesOrder;
	}

	public int getOrderItemNo() {

		return orderItemNo;
	}

	public void setOrderItemNo(int orderItemNo) {

		this.orderItemNo = orderItemNo;
	}

	public TMaterialMasterClient gettMaterialMasterClient() {

		return tMaterialMasterClient;
	}

	public void settMaterialMasterClient(
			TMaterialMasterClient tMaterialMasterClient) {

		this.tMaterialMasterClient = tMaterialMasterClient;
	}

	public Double getQuantity() {

		return quantity;
	}

	public void setQuantity(Double quantity) {

		this.quantity = quantity;
	}

	public TUnit gettUnit() {

		return tUnit;
	}

	public void settUnit(TUnit tUnit) {

		this.tUnit = tUnit;
	}

	public Double getUnitPrice() {

		return unitPrice;
	}

	public void setUnitPrice(Double unitPrice) {

		this.unitPrice = unitPrice;
	}

	public Double getSubTotal() {

		return subTotal;
	}

	public void setSubTotal(Double subTotal) {

		this.subTotal = subTotal;
	}

	public String getMaterialPic() {

		return materialPic;
	}

	public void setMaterialPic(String materialPic) {

		this.materialPic = materialPic;
	}

	public Double getQuantityDelivered() {

		return quantityDelivered;
	}

	public void setQuantityDelivered(Double quantityDelivered) {

		this.quantityDelivered = quantityDelivered;
	}

	public Double getQuantityConfirmed() {

		return quantityConfirmed;
	}

	public void setQuantityConfirmed(Double quantityConfirmed) {

		this.quantityConfirmed = quantityConfirmed;
	}

	public Date getPlanedTime() {

		return planedTime;
	}

	public void setPlanedTime(Date planedTime) {

		this.planedTime = planedTime;
	}

	public Date getActualTime() {

		return actualTime;
	}

	public void setActualTime(Date actualTime) {

		this.actualTime = actualTime;
	}

	public Date getGmtCreateTime() {

		return gmtCreateTime;
	}

	public void setGmtCreateTime(Date gmtCreateTime) {

		this.gmtCreateTime = gmtCreateTime;
	}

	public Date getGmtUpdateTime() {

		return gmtUpdateTime;
	}

	public void setGmtUpdateTime(Date gmtUpdateTime) {

		this.gmtUpdateTime = gmtUpdateTime;
	}

	public String getCreatedBy() {

		return createdBy;
	}

	public void setCreatedBy(String createdBy) {

		this.createdBy = createdBy;
	}

	public String getUpdatedBy() {

		return updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {

		this.updatedBy = updatedBy;
	}

	public boolean isDelete() {

		return isDelete;
	}

	public void setDelete(boolean isDelete) {

		this.isDelete = isDelete;
	}

}
